﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Kangaroo.Model
{
    public class SignalInfo
    {
        public Int64 Key { get; set; }

        public ChannelInfo Channel { get; set; }

        public int ChannelKey { get; set; }

        /// <summary>
        /// 时间
        /// </summary>
        public DateTime PdTime { get; set; }

        /// <summary>
        /// 平均放电量
        /// </summary>
        public float PdMean { get; set; }

        /// <summary>
        /// 最大放电量
        /// </summary>
        public float PdMax { get; set; }

        /// <summary>
        /// 最大放电相位
        /// </summary>
        public float PdPhase { get; set; }

        /// <summary>
        /// 放电频次
        /// </summary>
        public float PdRep { get; set; }

        /// <summary>
        /// 放电类型
        /// </summary>
        public string PdType { get; set; }

        public PdTypeInfo PdTypeInfo
        {
            get
            {
                var info = PdType.Split(';');
                double per;
                return new PdTypeInfo
                {
                    Type = info[0],
                    Percentage = info.Length >= 2 && double.TryParse(info[1], out per) ? per : 0.0
                };
            }
        }

        /// <summary>
        /// 放电类型频率
        /// </summary>
        public string PdTypeProb { get; set; }

        /// <summary>
        /// 放电位置
        /// </summary>
        public string PdLoc { get; set; }

        /// <summary>
        /// 局放等级
        /// </summary>
        public string PdLevel { get; set; }

        /// <summary>
        /// 波形文件位置
        /// </summary>
        public string PdFile { get; set; }

        /// <summary>
        /// 三维图谱数据
        /// </summary>
        public PrpsGraph PrpsGraph { get; set; }

        /// <summary>
        /// 三维图谱原始数据
        /// </summary>
        public byte[] PrpsGraphRawData { get; set; }
    }

    public class PdTypeInfo
    {
        public string Type { get; set; }
        public double Percentage { get; set; }
    }
}
